making python code parametrized